package org.zjh.model;

import java.util.ArrayList;

/**
 * @description: 玩家父类
 * @author 郑佳豪
 * @date 2024/10/10 15:36
 * @version 1.0
 */
public abstract class Player {
    //昵称
    private String nickname;
    //分数
    private int score;
    //手牌集合
    private ArrayList<Poker> pokerList  = new ArrayList<>();
    //下一个玩家
    private Player nextPlayer;
    //叫分结果
    private int callPointResult;
    //准备要出的牌的集合
    private ArrayList<Poker> discardPokerList = new ArrayList<>();
    //能否出牌
    private boolean canBeDiscardPoker = true;
    //是否出牌结束
    private boolean discardPokerOver = false;


    public Player() {
    }

    public Player(String nickname, int score) {
        this.nickname = nickname;
        this.score = score;
    }


    /**
     * 叫分方法
     */
    public abstract void callPoint(Player player);


    /**
     * 检查是否成功叫分
     * @return true 成功 false 失败
     */
    public abstract boolean isSuccessCallPoint();






    /**
     * 添加扑克牌方法
     * @param poker 扑克牌对象
     */
    public void addPoker(Poker poker){
        pokerList.add(poker);
    }


    /**
     * 出牌方法
     */
    public abstract void discardPoker();



    public String getNickname() {
        return nickname;
    }

    public void setNickname(String nickname) {
        this.nickname = nickname;
    }

    public int getScore() {
        return score;
    }

    public void setScore(int score) {
        this.score = score;
    }

    public ArrayList<Poker> getPokerList() {
        return pokerList;
    }

    public void setPokerList(ArrayList<Poker> pokerList) {
        this.pokerList = pokerList;
    }

    public Player getNextPlayer() {
        return nextPlayer;
    }

    public void setNextPlayer(Player nextPlayer) {
        this.nextPlayer = nextPlayer;
    }

    public int getCallPointResult() {
        return callPointResult;
    }

    public void setCallPointResult(int callPointResult) {
        this.callPointResult = callPointResult;
    }

    public ArrayList<Poker> getDiscardPokerList() {
        return discardPokerList;
    }

    public void setDiscardPokerList(ArrayList<Poker> discardPokerList) {
        this.discardPokerList = discardPokerList;
    }

    public boolean isCanBeDiscardPoker() {
        return canBeDiscardPoker;
    }

    public void setCanBeDiscardPoker(boolean canBeDiscardPoker) {
        this.canBeDiscardPoker = canBeDiscardPoker;
    }

    public boolean isDiscardPokerOver() {
        return discardPokerOver;
    }

    public void setDiscardPokerOver(boolean discardPokerOver) {
        this.discardPokerOver = discardPokerOver;
    }
}
